subjects = ["Science", "Maths", "English", "History", "Geography"] |
subjects[4] = "Computer Science" |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | subjects[4] = "Computer Science" |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
subjects.pop(2) |
subjects.pop(2) |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | subjects.pop(2) |
3 | subjects.pop(2) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
a = subjects.pop(4) |
print(a) |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | a = subjects.pop(4) |
3 | print(a) |
arr = ["red","blue","green","purple","orange"] |
1 | arr = ["red","blue","green","purple","orange"] |
arr = ["red","blue","green","purple","orange"] |
print(arr) |
i = input() |
print("Enter a colour") |
arr[0] = i |
1 | arr = ["red","blue","green","purple","orange"] |
2 | print("Enter a colour") |
3 | i = input() |
4 | arr[0] = i |
5 | print(arr) |
print(subjects) |
subjects[i] = j |
i = int(i) |
i = input() |
print(subjects[i]) |
print("Enter an index") |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
print("Enter a subject to replace it with") |
j = input() |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter an index") |
3 | i = input() |
4 | i = int(i) |
5 | print(subjects[i]) |
6 | print("Enter a subject to replace it with") |
7 | j = input() |
8 | subjects[i] = j |
9 | print(subjects) |
i = int(i) |
print(subjects[i]) |
print("Enter a subject to replace it with") |
if i.isdigit() and int(i) >= 0 and int(i) < len(subjects): |
while True: |
break |
else: |
print(subjects) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
subjects[i] = j |
i = input() |
j = input() |
print("Invalid integer") |
print("Enter an index") |
        i = int(i) |
print(subjects[i]) |
print("Enter a subject to replace it with") |
    if i.isdigit() and int(i) >= 0 and int(i) < len(subjects): |
while True: |
        break |
    else: |
print(subjects) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
subjects[i] = j |
    i = input() |
j = input() |
        print("Invalid integer") |
print("Enter an index") |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter an index") |
3 | while True: |
4 |     i = input() |
5 |     if i.isdigit() and int(i) >= 0 and int(i) < len(subjects): |
6 |         i = int(i) |
7 |         break |
8 |     else: |
9 |         print("Invalid integer") |
10 | print(subjects[i]) |
11 | print("Enter a subject to replace it with") |
12 | j = input() |
13 | subjects[i] = j |
14 | print(subjects) |
l = len(subjects) |
print(subjects) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
print("Enter a subject you wish to replace") |
for x in range(l): |
print("Enter the subject you wish to replace it with") |
subjects[x] = j |
j = input() |
i = input() |
if subjects[x] == i: |
break |
l = len(subjects) |
print(subjects) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
print("Enter a subject you wish to replace") |
for x in range(l): |
print("Enter the subject you wish to replace it with") |
        subjects[x] = j |
j = input() |
i = input() |
    if subjects[x] == i: |
        break |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter a subject you wish to replace") |
3 | i = input() |
4 | print("Enter the subject you wish to replace it with") |
5 | j = input() |
6 | l = len(subjects) |
7 | for x in range(l): |
8 |     if subjects[x] == i: |
9 |         subjects[x] = j |
10 |         break |
11 | print(subjects) |
print("Adding " + i) |
while True: |
if i == "Add": |
print("Add or Serve?") |
else: |
print("Enter someone to add") |
print("Queue") |
queue.append(i) |
print("Serving " + a) |
i = input() |
i = input() |
print(queue) |
queue = [] |
a = queue.pop(0) |
        print("Adding " + i) |
while True: |
    if i == "Add": |
    print("Add or Serve?") |
    else: |
        print("Enter someone to add") |
    print("Queue") |
        queue.append(i) |
        print("Serving " + a) |
        i = input() |
    i = input() |
    print(queue) |
queue = [] |
        a = queue.pop(0) |
1 | queue = [] |
2 | while True: |
3 |     print("Queue") |
4 |     print(queue) |
5 |     print("Add or Serve?") |
6 |     i = input() |
7 |     if i == "Add": |
8 |         print("Enter someone to add") |
9 |         i = input() |
10 |         queue.append(i) |
11 |         print("Adding " + i) |
12 |     else: |
13 |         a = queue.pop(0) |
14 |         print("Serving " + a) |
15 |          |
even.append(a) |
odd.append(a) |
print(odd) |
arr = [6,5,4,5,6,2,4] |
if a % 2 == 0: |
else: |
a = arr[x] |
print("Even") |
print("Odd") |
odd = [] |
print(even) |
for x in range(len(arr)): |
even = [] |
        even.append(a) |
        odd.append(a) |
print(odd) |
arr = [6,5,4,5,6,2,4] |
    if a % 2 == 0: |
    else: |
    a = arr[x] |
print("Even") |
print("Odd") |
odd = [] |
print(even) |
for x in range(len(arr)): |
even = [] |
1 | arr = [6,5,4,5,6,2,4] |
2 | even = [] |
3 | odd = [] |
4 | for x in range(len(arr)): |
5 |     a = arr[x] |
6 |     if a % 2 == 0: |
7 |         even.append(a) |
8 |     else: |
9 |         odd.append(a) |
10 | print("Even") |
11 | print(even) |
12 | print("Odd") |
13 | print(odd) |
arr[x] = arr[x] * 2 |
arr = [6,5,4,5,6,2,4] |
for x in range(len(arr)): |
print(arr) |
    arr[x] = arr[x] * 2 |
arr = [6,5,4,5,6,2,4] |
for x in range(len(arr)): |
print(arr) |
1 | arr = [6,5,4,5,6,2,4] |
2 | for x in range(len(arr)): |
3 |     arr[x] = arr[x] * 2 |
4 | print(arr) |
i = input() |
print("Enter index 2") |
subjects[j] = temp |
j = input() |
temp = subjects[i] |
print("Enter index 1") |
i = int(i) |
subjects[i] = subjects[j] |
j = int(j) |
print(subjects) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter index 1") |
3 | i = input() |
4 | i = int(i) |
5 | print("Enter index 2") |
6 | j = input() |
7 | j = int(j) |
8 | temp = subjects[i] |
9 | subjects[i] = subjects[j] |
10 | subjects[j] = temp |
11 | print(subjects) |
if arr[x] == arr: |
indexes = [] |
index.append(x) |
print(indexes) |
arr = [5,2,2,1,4,5,2,4,5,2] |
for x in range(len(arr)): |
    if arr[x] == arr: |
indexes = [] |
        index.append(x) |
print(indexes) |
arr = [5,2,2,1,4,5,2,4,5,2] |
for x in range(len(arr)): |
1 | arr = [5,2,2,1,4,5,2,4,5,2] |
2 | indexes = [] |
3 | for x in range(len(arr)): |
4 |     if arr[x] == arr: |
5 |         index.append(x) |
6 | print(indexes) |
s = str(arr[x]) |
print(arr) |
t = t + int(s[y]) |
for y in range(len(s)): |
arr[x] = t |
for x in range(len(arr)): |
arr = [242,142,525] |
t = 0 |
    s = str(arr[x]) |
print(arr) |
        t = t + int(s[y]) |
    for y in range(len(s)): |
    arr[x] = t |
for x in range(len(arr)): |
arr = [242,142,525] |
    t = 0 |
1 | arr = [242,142,525] |
2 | for x in range(len(arr)): |
3 |     t = 0 |
4 |     s = str(arr[x]) |
5 |     for y in range(len(s)): |
6 |         t = t + int(s[y]) |
7 |     arr[x] = t |
8 | print(arr) |
for x in range(len(arr)): |
t = 0 |
t = t + int(s[y]) |
s = str(arr[x]) |
arr[x] = t |
print(arr) |
arr = [242,142,525] |
for y in range(len(s)): |
for x in range(len(arr)): |
    t = 0 |
        t = t + int(s[y]) |
    s = str(arr[x]) |
    arr[x] = t |
print(arr) |
arr = [242,142,525] |
    for y in range(len(s)): |
1 | arr = [242,142,525] |
2 | for x in range(len(arr)): |
3 |     t = 0 |
4 |     s = str(arr[x]) |
5 |     for y in range(len(s)): |
6 |         t = t + int(s[y]) |
7 |     arr[x] = t |
8 | print(arr) |
9 |      |
print(arr) |
t = t + int(s[y]) |
s = str(arr[x]) |
arr = [242,142,525] |
t = 0 |
for y in range(len(s)): |
for x in range(len(arr)): |
arr[x] = t |
print(arr) |
        t = t + int(s[y]) |
    s = str(arr[x]) |
arr = [242,142,525] |
    t = 0 |
    for y in range(len(s)): |
for x in range(len(arr)): |
    arr[x] = t |
1 | arr = [242,142,525] |
2 | for x in range(len(arr)): |
3 |     t = 0 |
4 |     s = str(arr[x]) |
5 |     for y in range(len(s)): |
6 |         t = t + int(s[y]) |
7 |     arr[x] = t |
8 | print(arr) |
for x in range(5): |
row = "" |
for y in range(len(height)): |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
print(row) |
row = row + " " |
if height[y] >= currentHeight: |
row = row + "#" |
currentHeight = h - x |
else: |
for x in range(5): |
    row = "" |
    for y in range(len(height)): |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
    print(row) |
            row = row + " " |
        if height[y] >= currentHeight: |
            row = row + "#" |
    currentHeight = h - x |
        else: |
1 | height = [0,1,0,2,1,0,1,3,2,1,2,1] |
2 | |
3 | for x in range(5): |
4 |     currentHeight = h - x |
5 |     row = "" |
6 |     for y in range(len(height)): |
7 |         if height[y] >= currentHeight: |
8 |             row = row + "#" |
9 |         else: |
10 |             row = row + " " |
11 |     print(row) |
x = len(height) - x - 1 |
for x in range(h): #This for loop prints out the map |
row = row + " " |
break |
h = 5 |
row = "" |
row = row + colored.fg("blue") + "#" + colored.fg("white") |
currentHeight = h - x |
break |
water[x] = y - 1 |
for y in range(h): |
y = h - y #reverse the order, starting at 5 going to 0 |
if height[y] >= currentHeight: #If the terrain is equal to or higher than the water then print terrain |
for x in range(len(water)): #Start from the right and move left |
for y in range(len(height)): |
import colored |
print(row) |
elif water[y] >= currentHeight:#If the terrain is lower than the water level, draw the water |
print(water) |
row = row + "#" |
water[x] = y - 1 |
if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
else: #No water and no terrain |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
for x in range(len(water)): #Start from the left and move right |
water = [h,h,h,h,h,h,h,h,h,h,h,h] |
        x = len(height) - x - 1 |
for x in range(h): #This for loop prints out the map |
            row = row + " " |
            break |
h = 5 |
    row = "" |
            row = row + colored.fg("blue") + "#" + colored.fg("white") |
    currentHeight = h - x |
            break |
        water[x] = y - 1 |
for y in range(h): |
    y = h - y #reverse the order, starting at 5 going to 0 |
        if height[y] >= currentHeight: #If the terrain is equal to or higher than the water then print terrain |
    for x in range(len(water)): #Start from the right and move left |
    for y in range(len(height)): |
import colored |
    print(row) |
        elif water[y] >= currentHeight:#If the terrain is lower than the water level, draw the water |
print(water) |
            row = row + "#" |
        water[x] = y - 1 |
        if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
        else: #No water and no terrain |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
        if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
    for x in range(len(water)): #Start from the left and move right |
water = [h,h,h,h,h,h,h,h,h,h,h,h] |
1 | import colored |
2 | height = [0,1,0,2,1,0,1,3,2,1,2,1] |
3 | |
4 | h = 5 |
5 | water = [h,h,h,h,h,h,h,h,h,h,h,h] |
6 | for y in range(h): |
7 |     y = h - y #reverse the order, starting at 5 going to 0 |
8 |      |
9 |     for x in range(len(water)): #Start from the left and move right |
10 |         water[x] = y - 1 |
11 |         if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
12 |             break |
13 |      |
14 |     for x in range(len(water)): #Start from the right and move left |
15 |         x = len(height) - x - 1 |
16 |         water[x] = y - 1 |
17 |         if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
18 |             break |
19 |      |
20 | print(water) |
21 |              |
22 | for x in range(h): #This for loop prints out the map |
23 |     currentHeight = h - x |
24 |     row = "" |
25 |     for y in range(len(height)): |
26 |         if height[y] >= currentHeight: #If the terrain is equal to or higher than the water then print terrain |
27 |             row = row + "#" |
28 |         elif water[y] >= currentHeight:#If the terrain is lower than the water level, draw the water |
29 |             row = row + colored.fg("blue") + "#" + colored.fg("white") |
30 |         else: #No water and no terrain |
31 |             row = row + " " |
32 |     print(row) |
33 |              |
34 |      |